package com.azzcs.juc.executors;

import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * @Author: wzg
 * @Date: 2021/6/21 上午11:00
 */
public class Main {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newCachedThreadPool();
        executorService = Executors.newFixedThreadPool(1);
        executorService = Executors.newSingleThreadExecutor();
        executorService = Executors.newSingleThreadScheduledExecutor();
        executorService = Executors.newScheduledThreadPool(10);
        executorService = Executors.newWorkStealingPool();
        List<Runnable> runnables = executorService.shutdownNow();


        ScheduledExecutorService scheduled = Executors.newSingleThreadScheduledExecutor();
        scheduled.scheduleWithFixedDelay(()->{},1,1, TimeUnit.MICROSECONDS);
        scheduled.scheduleAtFixedRate(()->{},1,1, TimeUnit.MICROSECONDS);
    }
}
